package lanqiaotrain.t2;

import java.util.Scanner;

/**
 * @Author: Hasee
 * @Date: 2020-10-04 10:48:17
 */
public class Basic9 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int sum;
        //五位数
        for (int i = 10000; i < 100000; i++) {
            if (i % 10 == i / 10000 && i / 10 % 10 == i / 1000 % 10) {
                sum = 0;
                int j = i;
                while (j > 0) {
                    sum += j % 10;
                    j =j/ 10;
                }
                if (sum == n){
                    System.out.println(i);
                }
            }
        }
        //六位数
        for (int i = 100000; i < 1000000; i++) {
            if (i % 10 == i / 100000 && i / 10 % 10 == i / 10000 % 10 && i/1000%10==i/100%10) {
                sum = 0;
                int j = i;
                while (j > 0) {
                    sum += j % 10;
                    j =j/ 10;
                }
                if (sum == n){
                    System.out.println(i);
                }
            }
        }
    }
}
